# 定义一个列表变量
fruits = ["apple", "banana", "cherry"]

# 打印变量的值
print("Fruits:", fruits)

# 访问列表中的特定元素
first_fruit = fruits[0]
print("First fruit:", first_fruit)

# 切片操作提取子列表
sublist = fruits[1:3]
print("Sublist from index 1 to 2:", sublist)

# 判断列表是否包含某个元素
if "banana" in fruits:
    print("The list contains 'banana'.")
else:
    print("The list does not contain 'banana'.")

# 添加元素到列表末尾
fruits.append("orange")
print("Updated fruits:", fruits)

# 删除列表中的元素
fruits.remove("cherry")
print("Fruits after removing 'cherry':", fruits)
